using System;
using System.Drawing;
using System.Windows.Forms;

namespace WinformTemplete.Modules.Settings
{
    public partial class SettingsForm : Form
    {
        public SettingsForm()
        {
            InitializeComponent();
            InitializeCustomComponents();
        }

        private void InitializeCustomComponents()
        {
            // 创建主面板
            var mainPanel = new Panel
            {
                Dock = DockStyle.Fill,
                BackColor = Color.White
            };

            // 创建标题标签
            var titleLabel = new Label
            {
                Text = "系统设置",
                Font = new Font("微软雅黑", 16, FontStyle.Bold),
                AutoSize = true,
                Location = new Point(20, 20)
            };

            // 创建设置项面板
            var settingsPanel = new Panel
            {
                Location = new Point(20, 60),
                Size = new Size(600, 400),
                BackColor = Color.White,
                BorderStyle = BorderStyle.FixedSingle
            };

            // 添加设置项
            var themeLabel = new Label
            {
                Text = "主题设置",
                Font = new Font("微软雅黑", 12),
                Location = new Point(20, 20),
                AutoSize = true
            };

            var themeComboBox = new ComboBox
            {
                Location = new Point(150, 20),
                Width = 200,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            themeComboBox.Items.AddRange(new string[] { "浅色主题", "深色主题" });
            themeComboBox.SelectedIndex = 0;

            var languageLabel = new Label
            {
                Text = "语言设置",
                Font = new Font("微软雅黑", 12),
                Location = new Point(20, 60),
                AutoSize = true
            };

            var languageComboBox = new ComboBox
            {
                Location = new Point(150, 60),
                Width = 200,
                DropDownStyle = ComboBoxStyle.DropDownList
            };
            languageComboBox.Items.AddRange(new string[] { "简体中文", "English" });
            languageComboBox.SelectedIndex = 0;

            // 添加保存按钮
            var saveButton = new Button
            {
                Text = "保存设置",
                Font = new Font("微软雅黑", 11),
                Size = new Size(100, 35),
                Location = new Point(470, 350),
                BackColor = Color.FromArgb(0, 120, 215),
                ForeColor = Color.White,
                FlatStyle = FlatStyle.Flat
            };
            saveButton.FlatAppearance.BorderSize = 0;
            saveButton.Click += SaveButton_Click;

            // 添加控件到设置面板
            settingsPanel.Controls.AddRange(new Control[] { themeLabel, themeComboBox, languageLabel, languageComboBox, saveButton });

            // 添加控件到主面板
            mainPanel.Controls.AddRange(new Control[] { titleLabel, settingsPanel });

            // 设置窗体控件
            this.Controls.Add(mainPanel);
        }

        private void SaveButton_Click(object sender, EventArgs e)
        {
            MessageBox.Show("设置已保存", "提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
        }
    }
} 